package edu.arizona.sista.learn.activity.fluents.paths;

import java.io.IOException;
import java.io.PrintStream;
import java.util.Vector;

import edu.arizona.sista.learn.activity.fluents.paths.Scene;
import edu.arizona.sista.learn.activity.model.ActivityInstance;
import edu.arizona.sista.learn.activity.model.Predicate;

public class Test {
	public static void main(String[] args) {

//		String path1 = "data/input/tracks/CHASE3_A1_C1_Act1_6_PARK_MC_AFTN_b436da2b-07b6-11e0-91eb-e80688cb869a/";
//		test(path1, 1);
//		
//		String path2 = "data/input/tracks/format2/";
//		test(path2, 2);
		
		String path3 = "data/input/tracks/CR1_00001/";
		test(path3, 3);
	}
	
	public static void test(String path, int conf) {
		try {
			Scene scene = Scene.load(path, conf);
			System.out.println(scene);
			PredicateExtractor2 extractor = new PredicateExtractor2(scene, PredicateExtractor.DataType.Points);
			Vector<Vector<Predicate>> preds = extractor.extractPredicates();
			int numPreds = 0;
			for (int i = 0; i < preds.size(); i++) {
				numPreds += preds.get(i).size();
			}
			System.out.println(numPreds + " predicates");
			System.out.println(preds);
			ActivityInstance fluents = extractor.getPredicateIntervals(preds, false);
			System.out.println(fluents.getIntervalsMap());

			System.out.println(fluents.toString());
			
			PrintStream out = new PrintStream("data/output/test-fluents.lisp");
			out.println(fluents.toString());
			
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}
